<script type="text/javascript">
    $.CurrentDialog.find("#importExcelBtn").on("click", function () {
        var form =  $.CurrentDialog.find("#importExcelForm");
        form.attr("action", "{:U('Admin/Tree/importExcel')}");
        form.bjuiajax("ajaxForm", {
            callback: function (data) {
                $(this).bjuiajax('ajaxDone', data);
                if(data["data"]) {
                    $.CurrentDialog.find("#errorInfo").html(data["data"].join("<br/>"));
                } else {
                    $(this).navtab("refresh", "Admin/Tree/treeList");
                }
            }
        });
        return false;
    });
</script>
<style type="text/css">
    #importExcelForm table > tbody > tr > td {border-top:0;}
    #importExcelForm table td.x85 {width:85px;text-align:right;}
</style>
<div class="bjui-pageContent">
    <form id="importExcelForm" enctype="multipart/form-data">
        <table class="table table-condensed table-hover" width="100%">
            <tbody>
                <tr>
                    <td class="x85">
                        <label for="file" class="control-label x85">导入文件：</label>
                    </td>
                    <td>
                        <input type="file" name="file" id="file" >
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="control-label x85"></label>
                    </td>
                    <td>
                        <button type="submit" class="btn-default" id="importExcelBtn">导入</button>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <div id="errorInfo" style="height:150px;width:100%;overflow-y:scroll;color:red;"></div>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</div>